<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title></title>
		<#include "/admin/include/head.htm">
		<#include "/admin/include/upload.ftl">
		<script type="text/javascript">
			$(function() {
				var mainform = $("#mainform");
				//表单底部按钮
				LG.setFormDefaultBtn(f_cancel, function() {
					f_save(mainform, "b2c_brand_list");
				});

				$(".browserButton").browser({
					"createThumb" : 0, //创建缩略图
					"callback" : function(url, store_path) {
						$(this).prev().val(store_path);
					},
					uploadType : 'brand'
				}, function() {
					$.ligerDialog.close();
				});
				//标志editor编辑器图片本地上传目录
				setting.uploadType = "brand";
			});
		</script>
	</head>
	<#if !brand??>
	<#assign isAdd = true />
	<#else>
	<#assign isEdit = true />
	</#if>
	<body style="overflow:hidden;padding:10px;">
		<form action="<#if isAdd??>${base}/admin/b2c/brand/save.jhtml<#else>${base}/admin/b2c/brand/update.jhtml</#if>" method="post" id="mainform" class="validate">
			<div id="tabcontainer" style="overflow:hidden;margin:3px;">
				<#if !isAdd??>
				<input type="hidden" name="id" value="${(brand.id)!''}"/>
				</#if>
				<table class="table" style="width:100%;">
					<tr>
						<th>品牌名称:</th>
						<td>
						<input type="text" name="name" value="${(brand.name)!''}"  maxlength="20"
						class="formText {required: true, maxlength: 20, remote:'${base}/admin/brand/checkBrandName.jhtml?oldName=${(brand.name)!''}', messages: {remote: '品牌名称已存在!'}}"/>
						</td>
					</tr>
					<tr>
						<th>是否推荐:</th>
						<td><@u.radio name="isRecommend" list={'true': '是', 'false':'否'}
						value="${(brand.isRecommend?string('true', 'false'))!'false'}"/>(推荐品牌，会在首页中显示) </td>
					</tr>
					<tr>
						<th>网址:</th>
						<td>
						<input type="text" name="url" value="${(brand.url)!}"
						class="formText {maxlength: 120}"/>
						</td>
					</tr>
					<tr>
						<th>LOGO:</th>
						<td>
						<input type="input" value="${(brand.logo)!''}" name="logo" class="formText {required:true}"/>
						<input type="button" value="选择图片" class="button browserButton">
						</td>
					</tr>
					<tr>
						<th>首页展示图片:</th>
						<td>
						<input type="input" value="${(brand.advert)!''}" name="advert" class="formText"/>
						<input type="button" value="选择图片" class="button browserButton">
						</td>
					</tr>
					<tr>
						<th>详情页展示图片:</th>
						<td>
						<input type="input" value="${(brand.detailPic)!''}" name="detailPic" class="formText"/>
						<input type="button" value="选择图片" class="button browserButton">
						</td>
					</tr>
					<tr>
						<th>排序:</th>
						<td>
						<input type="text" name="priority" value="${(brand.priority)!10}"
						class="formText {digits: true, maxlength:3}" title="只允许输入零或正整数"/>
						</td>
					</tr>
					<tr>
						<th>介绍:</th>
						<td><textarea id="editor" name="introduction" class="formArea" style="width: 100%;height: 320px;resize: none;">${(brand.introduction)!''}</textarea></td>
					</tr>
				</table>
			</div>
		</form>
	</body>
</html>